home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / sound / ym2151.h < prev    next >
C/C++ Source or Header  |  2000-05-19  |  3KB  |  82 lines

  1. /*
  2. **
  3. ** File: ym2151.h - header file for software implementation of YM2151
  4. **                                            FM Operator Type-M(OPM)
  5. **
  6. ** (c) 1997,1998,1999,2000 Jarek Burczynski (s0246@priv4.onet.pl)
  7. ** Some of the optimizing ideas by Tatsuyuki Satoh
  8. **
  9. ** Version 2.140 May, 19th 2000
  10. **
  11. **
  12. ** I would like to thank the following people for making this project possible:
  13. **
  14. ** Beauty Planets - for making a lot of real YM2151 samples and providing
  15. ** additional informations about the chip. Also for the time spent making
  16. ** the samples and the speed of replying to my endless requests.
  17. **
  18. ** Shigeharu Isoda - for general help, for taking time to scan his YM2151
  19. ** Japanese Manual first of all, and answering MANY of my questions.
  20. **
  21. ** Nao - for giving me some info about YM2151 and pointing me to Shigeharu.
  22. ** Also for creating fmemu (which I stil use to test the emulator).
  23. **
  24. ** Aaron Giles and Chris Hardy - they made some samples of one of my favourite
  25. ** arcade games so I could compare it to my emulator.
  26. **
  27. ** Bryan McPhail and Tim (powerjaw) - for making some samples.
  28. **
  29. ** Ishmair - for the datasheet and motivation.
  30. */
  31.  
  32. #ifndef _H_YM2151_
  33. #define _H_YM2151_
  34.  
  35. /* 16- and 8-bit samples (signed) are supported*/
  36. #define SAMPLE_BITS 16
  37.  
  38. #if (SAMPLE_BITS==16)
  39.     typedef INT16 SAMP;
  40. #endif
  41. #if (SAMPLE_BITS==8)
  42.     typedef signed char SAMP;
  43. #endif
  44.  
  45. /*
  46. ** Initialize YM2151 emulator(s).
  47. **
  48. ** 'num' is the number of virtual YM2151's to allocate
  49. ** 'clock' is the chip clock in Hz
  50. ** 'rate' is sampling rate
  51. */
  52. int YM2151Init(int num, int clock, int rate);
  53.  
  54. /* shutdown the YM2151 emulators*/
  55. void YM2151Shutdown(void);
  56.  
  57. /* reset all chip registers for YM2151 number 'num'*/
  58. void YM2151ResetChip(int num);
  59.  
  60. /*
  61. ** Generate samples for one of the YM2151's
  62. **
  63. ** 'num' is the number of virtual YM2151
  64. ** '**buffers' is table of pointers to the buffers: left and right
  65. ** 'length' is the number of samples that should be generated
  66. */
  67. void YM2151UpdateOne(int num, INT16 **buffers, int length);
  68.  
  69. /* write 'v' to register 'r' on YM2151 chip number 'n'*/
  70. void YM2151WriteReg(int n, int r, int v);
  71.  
  72. /* read status register on YM2151 chip number 'n'*/
  73. int YM2151ReadStatus(int n);
  74.  
  75. /* set interrupt handler on YM2151 chip number 'n'*/
  76. void YM2151SetIrqHandler(int n, void (*handler)(int irq));
  77.  
  78. /* set port write handler on YM2151 chip number 'n'*/
  79. void YM2151SetPortWriteHandler(int n, mem_write_handler handler);
  80.  
  81. #endif /*_H_YM2151_*/
  82.